<template>
  <div>
    <h1> {{ msg }} </h1>
    <button @click="rev" > 翻转</button>
  </div>
</template>

<script>
export default {
  name: 'WanghaoApp',

  data() {
    return {
      msg:'the word'
    };
  },

  mounted() {
    
  },

  methods: {
    rev() {
      //将msg切割成字符组将字符组反转再赋值给msg
      this.msg = this.msg.split('').reverse().join('')
    }
  },
};
</script>

<style lang="scss" scoped>

</style>